package br.com.consignum.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class HomeActivity extends Activity {

    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.home_activity);
	
	if (android.os.Build.VERSION.SDK_INT > 9) {
	    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
	    StrictMode.setThreadPolicy(policy);
	}
	clickTelefonesUteis();
	clickLogin();

    }

    private void clickTelefonesUteis() {

	ImageButton imageButton = (ImageButton) findViewById(R.id.home_activity_acessar_conta);

	imageButton.setOnClickListener(new OnClickListener() {
	    public void onClick(View view) {
		Intent intent = new Intent(HomeActivity.this, LoginActivity.class);
		startActivity(intent);
	    }
	});
    }

    private void clickLogin() {

	ImageButton imageButton = (ImageButton) findViewById(R.id.home_activity_telefones_uteis);

	imageButton.setOnClickListener(new OnClickListener() {
	    public void onClick(View view) {
		Intent intent = new Intent(HomeActivity.this, TelefonesUteisActivity.class);
		startActivity(intent);
	    }
	});
    }

}
